syntax = "proto3";

option go_package = ".;proto";

package proto;

service ConfigSync {
  rpc Ping(EmptyMessage) returns (EmptyMessage) {}
  rpc Sync(UpdateConfigEvent) returns (EmptyMessage) {}
  rpc LastUpdate(EmptyMessage) returns (ServerTime) {}
  rpc GetScopes(EmptyMessage) returns (Scopes) {}
  rpc GetTemplates(EmptyMessage) returns (Templates) {}
  rpc GetNamespaces(EmptyMessage) returns (Namespaces) {}
  rpc GetTriggers(EmptyMessage) returns (Triggers) {}
}

message EmptyMessage {

}

message UpdateConfigEvent {
  string type = 1;
  string json = 2;
  string action = 3;
  int64 time = 4;
}

message ServerTime {
  int64 time = 1;
}

message Scopes {
  string json = 1;
}

message Templates {
  string json = 1;
}
message Namespaces {
  string json = 1;
}
message Triggers {
  string json = 1;
}